<template>
<div>
<h1>从后端获取商品数据列表</h1>
<ul>
    <li v-for="(item,index) in goodsList" :key=index>{{ goodsList }}</li>
</ul>
</div>
</template>
<script>
import listApi from '@/api/good'
export default{
    data(){
        return {
            goodsList:[],
        }
    },
    methods:{
        async getList(){
            this.goodsList=await listApi('/api/goods')
        }
    },
    mounted(){
        getList()
    }
}
</script>